package com.balance.anole.client.retail.provider;

import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

import com.balance.anole.business.to.ShopReceiptTO;
import com.balance.anole.utils.DateUtil;

public class HoldSelectProvider extends LabelProvider implements
		ITableLabelProvider {

	@Override
	public Image getColumnImage(Object element, int columnIndex) {
		return null;
	}

	@Override
	public String getColumnText(Object element, int columnIndex) {
		ShopReceiptTO shopReceiptTO = (ShopReceiptTO)element;
		switch(columnIndex){
			case 0:
				return shopReceiptTO.getReceiptNum();
			case 1:
				return shopReceiptTO.getSeller().getStaffName();
			case 2:
				return DateUtil.format(shopReceiptTO.getCreateDt(), DateUtil.DEFALT_FORMAT_DATETIME2);
			case 3:
				return shopReceiptTO.getTotalNumOfPdtItem().toString();
			case 4:
				return shopReceiptTO.getLineNum();

			default :
				return "unknown " + columnIndex;
		}
	}

}
